package com.qf.controller;

import com.qf.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * author:z
 * time:2021/12/15 17:28
 * description:
 */
@RestController
public class TestController {

    @Value("${name}")
    private String name;

    @Value("${users[0].username}")
    private String username;
    @Value("${users[1].sex}")
    private String sex;

    @Autowired
    private User user;

    @RequestMapping("/test")
   public String test(){
        System.out.println("username:"+username);
        System.out.println("sex:"+sex);
        System.out.println("user:"+user);
       return "success";
   }
}
